<?php
/*
 * Created on 30 sep. 2010
 * Created by Ludovic Reenaers
 * lreenaers@hotmail.com
 */
class LanguagePadGenerator extends Generator{

	function dump(){

		$DAO = $this->Factory->getLangueDAO();
		$page = "<ul>";
		$LngTab = $DAO->getAllAvailable();
		$origUrl = str_replace("/","{{-}", substr($_SERVER["REQUEST_URI"],strlen($_SERVER["SCRIPT_NAME"])+1));
		foreach ($LngTab as $lng){
			$page .= "<li>";
			$info = $lng->getIso();
			if ($info == $_SESSION['langue']){
				$page .= '<span class="active">'.ucfirst($info).'</span>';
			}else{
				$page .= '<a href="'.$_SESSION['config']->controler.'?/language/change/'.$info.'/'.$origUrl.'" title="'.$lng->getLabel($info).'" alt="'.$lng->getLabel($info).'">'.ucfirst($info).'</a>';
			}
			$page .= "</li>";
		}


		$page .= "</ul>";
		return $page;
	}

}
?>